﻿@model FavoriteStoreModel
@using Nop.Web.Models.Catalog;

<div id="flyout-storelist">

    <div class="mini-storelist">

        <div class="cart-top">
            
            @if (Model.Stores.Count() == 0)
            {
                //T("ShoppingCart.Mini.NoItems")
                <div>Coming Soon</div>
            }
            else
            {
                if (Model.Stores.Count() == 1)
                {
                    //+string+
                    //@Html.Raw(string.Format(@T("ShoppingCart.Mini.OneItemText").Text, string.Format("<a href=\"{0}\" class=\"items\">{1}</a>", Url.RouteUrl("Wishlist"), T("ShoppingCart.Mini.OneItem").Text)))
                    <span>There is <span class="items">@Model.Stores.Count() store</span> in your favorite list.</span>
                }
                else
                {
                    //+string+
                    //@Html.Raw(string.Format(@T("ShoppingCart.Mini.SeveralItemsText").Text, string.Format("<a href=\"{0}\" class=\"items\">{1}</a>", Url.RouteUrl("Wishlist"), string.Format(T("ShoppingCart.Mini.SeveralItems").Text, itemCount))))
                    <span>There are <span class="items">@Model.Stores.Count() stores</span> in your favorite list.</span>
                }
                <!--<a class="minicart-clearcart" href="@Url.RouteUrl("RemoveAllProductsFromCart", new { shoppingCartTypeId = 2 })" onclick="AjaxCart.addproductvarianttocart('@Url.RouteUrl("RemoveAllProductsFromCart", new { shoppingCartTypeId = 2 })'); return false;">Clear Wishlist</a>-->
                <a href="javascript:void(0)" class="ministorelist-clearstores" onclick="AjaxCart.addstoretofavorite('@Url.Action("RemoveAllStoresFromFavorite", "Catalog", new { area = "Commerce"})');return false;">Clear All Stores</a>
            }
        </div>

        @if (Model.Stores.Count > 0)
        {
        <div class="storelist-items">
        <table>
            <tbody>
                @for (int i = 0; i < Model.Stores.Count; i++)
                {
                    var store = Model.Stores[i];
                    <tr class="item @(i == 0 ? "first" : null) @(i % 2 == 0 ? "odd" : "even")">
                            <td class="picture">
                                <div class="cart-item-image">
                                    <a href="@Url.RouteUrl("Store", new { storeId = store.StoreId, SeName = store.StoreSeName })" title="@store.Picture.Title">
                                        <img alt="@store.Picture.AlternateText" src="@store.Picture.ImageUrl" title="@store.Picture.Title" />
                                    </a>
                                </div>
                            </td>
                        <td class="store">
                            <div class="name">
                                <a href="@Url.RouteUrl("Store", new { storeId = store.StoreId, SeName = store.StoreSeName })">@store.StoreName</a>
                            </div>
                        </td>
                        <td class="store-remove">
                            <div class="name">
                                <a href="javascript:void(0)" title="Remove from Favorite Store List" class="icon icon-remove" onclick="AjaxCart.addstoretofavorite('@Url.Action("RemoveStoreFromFavorite", "Catalog", new { area = "Commerce", storeId = store.StoreId })');return false;">@T("Common.Remove")</a>
                            </div>
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        </div>
        }

    </div>
</div>
